import logging
import re
from threading import Lock
from typing import Iterable

from hubstation.downloader import Downloader
from hubstation.helper.db_helper import DbHelper
from hubstation.helper.rss_helper import RssHelper
from hubstation.utils.commons import singleton
from hubstation.workflow.collector.base import BaseCollector

logger = logging.getLogger(__name__)


lock = Lock()

@singleton
class Rss:
    downloader = None
    searcher = None
    dbhelper = None
    rsshelper = None
    subscribe = None

    def __init__(self):
        self.init_config()

    def init_config(self):
        # self.media = Media()
        self.downloader = Downloader()
        # self.sites = Sites()
        # self.siteconf = SiteConf()
        # self.filter = Filter()
        self.dbhelper = DbHelper()
        self.rsshelper = RssHelper()
        # self.subscribe = Subscribe()

    def rssdownload(self):
        """
        RSS订阅搜索下载入口，由定时服务调用
        """
